Skip to content

Fixes #4963, #5064. FileDialog nav fixes & TableView redesign - #5062

Merged
tig merged 39 commits into
developfrom
Issue-4963-filedialog
Apr 26, 2026
Merged

Fixes #4963, #5064. FileDialog nav fixes & TableView redesign#5062
tig merged 39 commits into
developfrom
Issue-4963-filedialog

Conversation

@tig

@tig tig commented Apr 22, 2026

Copy link
Copy Markdown
Member

Summary

FileDialog Fixes

  • Fixed keyboard navigation issues in FileDialog
  • Fixed TableView activation to use OnActivating pattern
  • Fixed TableView key handling

TableView Redesign (Breaking Changes)

Type consolidation & IValue support:

  • Consolidated \SelectedCellChangedEventArgs\ into immutable \TableSelection\ / \TableSelectionRegion\ types
  • Implemented \IValue<TableSelection?>\ on \TableView\
  • \TableSelectionRegion\ properties are init-only for \GetHashCode\ safety

Terminology — \Selection\ → \Cursor\ for navigation APIs:

  • \ChangeSelectionByOffset\ → \MoveCursorByOffset\
  • \ChangeSelectionToEndOfRow\ → \MoveCursorToEndOfRow\
  • \ChangeSelectionToStartOfRow\ → \MoveCursorToStartOfRow\
  • \ChangeSelectionToEndOfTable\ → \MoveCursorToEndOfTable\
  • \ChangeSelectionToStartOfTable\ → \MoveCursorToStartOfTable\
  • Backing fields: _selectedColumn/_selectedRow\ → _cursorColumn/_cursorRow\
  • All XML docs updated: \selected cell\/\�ctive cell\ → \cursor cell\

Return type cleanup:

  • All cursor-movement and selection methods return \�ool\ (true = success, false = null table guard)
  • All \AddCommand\ lambdas collapsed to single-line expressions

Partial class extraction:

  • Created \TableView.Content.cs\ for all content/viewport-related members (\ColumnOffset, \RowOffset, \CalculateContentSize, \MaxViewPort, \EnsureValidScrollOffsets, \UseAllRowsForContentCalculation, \RefreshContentSize, \OnViewportChanged)

Bug fixes:

  • Fixed \ToggleExtendKeyboard\ — all three branches had inverted logic (toggle-off was a no-op, dead code in else branch)
  • Fixed \GetAllSelectedCells: incorrect \Count == 0\ → \Count > 0\

XML docs & documentation:

  • Full pass on XML docs for all TableView types
  • Rewrote \docfx/docs/tableview.md\ as complete deep-dive

Known Issue

  • Ctrl+Click adds to a selection region but does not remove (toggle off) — regression to be fixed separately

Remaining (future PR)

  • Legacy API removal: \CursorChanged, \SelectedColumn/\SelectedRow\ properties, \CellActivated, \CellToggled, \TableViewSelectionSnapshot\

tig added 5 commits April 21, 2026 09:23
Fixes text input controls to ignore Alt/Ctrl-modified keys, even with AssociatedText (Kitty protocol). Updates FileDialog TableView height. Adds regression tests for input handling and hotkey routing. Documents FileDialog keyboard/nav issues. Refactors KeyboardEventTests for clarity.
Improve FileDialog navigation and TableView key handling

- Reset TableView viewport X and Y to 0 on navigation for consistent top-left alignment in FileDialog.
- Enable TabStop on _tableViewContainer for better keyboard accessibility.
- Adjust _tableView height and anchor _tbFind Y position for improved layout robustness.
- Refactor TableView key handling: ignore control/modified keys, handle navigation only when focused and rows exist, and return true when a key is handled.
tig added 3 commits April 23, 2026 07:33
Replaces OnActivated with OnActivating, updating the method to return a bool based on ToggleCurrentCellSelection. This supports cancellable or conditional activation in line with new event handling conventions.
tig added 11 commits April 23, 2026 15:57
Refactor TableView to v2 command/event architecture

- Implements IValue<Point?> and standard ValueChanged events
- Replaces OnMouseEvent with MouseBindings for all mouse actions
- Aligns Command.Accept/Activate/Toggle semantics to v2 standards
- Adds DefaultKeyBindings (Emacs, Home/End, Space, etc.)
- Uses C# 14 semi-auto properties for selection, default -1
- Moves collection-navigator logic to OnKeyDownNotHandled
- Threads ICommandContext through selection/navigation methods
- Marks legacy events/types as [Obsolete] with shims for compat
- Updates FileDialog and DatePicker to new TableView API
- Adds/updates tests and documents changes in tableview-refactor-summary.md
- Cleans up code style and removes dead code throughout
Comprehensive tests for TableView navigation, selection, events, and edge cases. Ensures current behavior is preserved ahead of planned redesign.
Refactored TableView to use TableSelection/TableSelectionRegion for richer selection state, replacing Point-based selection. Renamed EnsureSelectedCellIsVisible to EnsureCursorIsVisible and updated all references. Changed Command.Toggle to Command.ToggleExtend for extended selection. Improved null handling for Table and selection state, preventing NullReferenceExceptions. Updated tests and documentation to match the new model. Made minor code style and naming improvements.
Replaced all usages of SelectedRow/SelectedColumn with the new Value property and its Cursor.X/Y members for improved selection state management and null-safety. Updated event handlers to use ValueChanged instead of SelectedCellChanged, and replaced direct selection assignments with SetSelection calls. Modernized UI control initialization, streamlined menu/status bar construction, and improved code style and null handling throughout. Marked SelectedCellChanged as obsolete and updated tests and scenarios to use the new selection APIs.
No code modifications were present in the provided diff. No commit necessary.
Renamed the TableView event and event args from SelectedCellChanged/SelectedCellChangedEventArgs to CursorChanged/CursorChangedEventArgs. Updated all references, event invocations, and tests accordingly. Improved comments to clarify the event tracks cursor position changes, not cell selection.
Major overhaul of TableView selection and event model:
- Remove obsolete events (CellActivated, CellToggled, CursorChanged) and related args.
- All selection state now managed via Value (TableSelection).
- Internal selection fields are private; use SetSelection/Value APIs.
- Update all code/tests to use Value.Cursor and ValueChanged.
- Accept/Accepted replaces CellActivated; ToggleExtend handled directly.
- Deep-copy multi-selection regions for immutability.
- Refactor navigation, selection, and rendering to new model.
- Update all scenarios and tests for new APIs.
- Modernize code style and remove redundant code.
Improved and expanded XML documentation and in-code comments for TableView and related sources, fixing typos and grammar for accuracy and consistency. Major updates to tableview.md add a detailed table of contents, expanded sections, code examples, and event usage. Minor code fixes and improved parameter tags enhance maintainability and developer experience.
Refactored TableView.Selection.cs to move IValue<TableSelection?> implementation to the end of the file and organize related properties. Changed TableSelectionRegion to use init-only properties for immutability. Updated selection region logic to use immutable instances, improved region clamping, and fixed minor logic issues. Enhanced code style and maintainability without altering selection behavior.
Refactor TableView internals and API to use "cursor" instead of "selected"/"selection" for navigation state. Update all related fields, methods, comments, and tests for clarity and consistency. No functional changes; improves code readability and aligns with TableSelection.Cursor semantics.
Reorganize TableView by moving content-related properties and methods (content size, scrolling, viewport management) into TableView.Content.cs. This structural refactor improves code organization, separation of concerns, and maintainability. No functional changes introduced.
@tig tig changed the title Fixes #4963 - File Dialog nav issues Fixes #4963, #5064. FileDialog nav fixes & TableView redesign Apr 24, 2026
tig added 3 commits April 24, 2026 15:50
Comprehensive TableView API overhaul for v2.0.0: unified selection types, IValue<TableSelection?> support, navigation API terminology shift from "Selection" to "Cursor", and legacy API deprecation. Fixes keyboard selection toggling and region calculation bugs. Extracts content/viewport logic to a partial class and updates XML/docs. Ctrl+Click toggle regression noted for follow-up.
@tig

tig commented Apr 24, 2026

Copy link
Copy Markdown
Member Author

I'm currently working on two last issues:

  • TableView - Ctrl-Click extends selection to include the clicked cell but it does not do the opposite - FIXED
  • FileDialog - Still resizes crazily.

@tig
tig requested review from YourRobotOverlord and Copilot and removed request for Copilot April 24, 2026 21:57
tig added 4 commits April 26, 2026 08:41
FileDialog TreeView feature is now disabled via `#if !FILEDIALOG_ENABLE_TREE`, hiding all related UI and logic. TreeView initialization and toggle button are only present when the feature is off. `FileDialogStyle` now supports a nullable file system and defaults `DefaultUseColors` to true. FileDialog-related config settings are removed. `TableView.TruncateOrPad` now truncates by grapheme cluster, preventing surrogate pair corruption. Adds a test to ensure truncation does not throw or produce invalid surrogates with emoji.
Removes FILEDIALOG_ENABLE_TREE conditional blocks, making the directory tree, toggle button, and related styles always active in FileDialog. Updates FileDialogStyle and tests to support the unified implementation. FileDialogExamples now sets PreserveFilenameOnDirectoryChanges via checkbox. Tree functionality is now a standard, always-on part of the dialog UI.
- Add ".lnk" color mapping to FileSystemColorProvider
- Refine FileDialog pane border and alignment
- Reorder _treeView initialization for clarity
- Simplify TableView style for a cleaner appearance
- Use theme-based colors in TableView for consistency
- Ensure column color getter and style order are correct
- Set AllowsMultipleSelection to false in FileDialog
- Refactor ColumnStyle.Visible to use auto-property and MaxWidth logic
@tig
tig merged commit 3dbaceb into develop Apr 26, 2026
11 checks passed
@tig
tig deleted the Issue-4963-filedialog branch April 26, 2026 15:47
@tznind

tznind commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

File dialog in designer is now putting CPU to 100% just clicking around in TableView.

This happens in all 3 of these versions:

2.0.0-rc.5
2.0.1-develop.1
2.0.0-develop.5376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants